﻿Public Class frmDeclaration
    Private Sub loadDeclare()
        Dim sql = "select declaration from tbl_declare"
        Dim dec = Cmd.ExecuteScalar(sql)
        txtdeclare.Text = dec
    End Sub

    Public Sub New()

        ' This call is required by the designer.
        InitializeComponent()
        loadDeclare()
        ' Add any initialization after the InitializeComponent() call.

    End Sub

    Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
        addDeclare()
    End Sub

    Private Sub addDeclare()
        Dim sql = "update tbl_declare set declaration=@dec"
        Try
            Cmd.Parameters("@dec") = txtdeclare.Text
            Cmd.ExecuteNonQuery(sql)
            myMsgbox.show("update declaration success", "Declare")
        Catch ex As Exception
            myMsgbox.show("update declaration Fail!!", "Declare")
        End Try
        
    End Sub

End Class